<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./vue.js"></script>
</head>
<body>
<div id="root">
    <!--  未使用修饰符  -->
    <a @click="go" href="http://www.baidu.com">百度</a>
    <form @submit="fn" action="http://www.baidu.com">
        <button>点我</button>
    </form>

    <hr/>
    <!--  使用修饰符  -->
    <a @click.prevent="go2" href="http://www.baidu.com">百度</a>
    <form @submit.prevent="fn2" action="http://www.baidu.com">
        <button>点我</button>
    </form>
</div>
</body>
<script>
    new Vue({
        el: "#root",
        methods:{
            go(e){
                alert(e.target.innerText);
                e.preventDefault();
            },
            fn(e){
                alert("lala");
                e.preventDefault();
            },
            go2(e){
                alert(e.target.innerText);
            },
            fn2(e){
                alert("lala");
            }
        }
    })
</script>
</html>